<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>TFCMS: /home/reeko5k/www/tfcms/modules/tfcms.class.php Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">TFCMS
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('tfcms_8class_8php.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">/home/reeko5k/www/tfcms/modules/tfcms.class.php</div>  </div>
</div><!--header-->
<div class="contents">
<a href="tfcms_8class_8php.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?php
<a name="l00002"></a>00002 
<a name="l00014"></a>00014 <span class="comment">/*</span>
<a name="l00015"></a>00015 <span class="comment">    This file is part of TFCMS.</span>
<a name="l00016"></a>00016 <span class="comment"></span>
<a name="l00017"></a>00017 <span class="comment">    TFCMS is free software: you can redistribute it and/or modify</span>
<a name="l00018"></a>00018 <span class="comment">    it under the terms of the GNU General Public License as published by</span>
<a name="l00019"></a>00019 <span class="comment">    the Free Software Foundation, either version 3 of the License, or</span>
<a name="l00020"></a>00020 <span class="comment">    (at your option) any later version.</span>
<a name="l00021"></a>00021 <span class="comment"></span>
<a name="l00022"></a>00022 <span class="comment">    TFCMS is distributed in the hope that it will be useful,</span>
<a name="l00023"></a>00023 <span class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00024"></a>00024 <span class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00025"></a>00025 <span class="comment">    GNU General Public License for more details.</span>
<a name="l00026"></a>00026 <span class="comment"></span>
<a name="l00027"></a>00027 <span class="comment">    You should have received a copy of the GNU General Public License</span>
<a name="l00028"></a>00028 <span class="comment">    along with TFCMS. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00029"></a>00029 <span class="comment">*/</span>
<a name="l00030"></a>00030 
<a name="l00031"></a><a class="code" href="tfcms_8class_8php.html#a2e2d0cfd252afeac4d33f3f77b90226c">00031</a> <a class="code" href="tfcms_8class_8php.html#a2e2d0cfd252afeac4d33f3f77b90226c">$_SERVER</a>[<span class="stringliteral">&quot;DOCUMENT_ROOT&quot;</span>] = (isset(<a class="code" href="tfcms_8class_8php.html#a2e2d0cfd252afeac4d33f3f77b90226c">$_SERVER</a>[<span class="stringliteral">&quot;SUBDOMAIN_DOCUMENT_ROOT&quot;</span>]))
<a name="l00032"></a>00032                                                   ? <a class="code" href="tfcms_8class_8php.html#a2e2d0cfd252afeac4d33f3f77b90226c">$_SERVER</a>[<span class="stringliteral">&quot;SUBDOMAIN_DOCUMENT_ROOT&quot;</span>]
<a name="l00033"></a>00033                                                   : <a class="code" href="tfcms_8class_8php.html#a2e2d0cfd252afeac4d33f3f77b90226c">$_SERVER</a>[<span class="stringliteral">&quot;DOCUMENT_ROOT&quot;</span>];
<a name="l00034"></a><a class="code" href="tfcms_8class_8php.html#a18715b3adf7d20a38a06fd9c88cd3a4b">00034</a> define(<span class="stringliteral">&quot;__cwd&quot;</span>, getcwd());
<a name="l00035"></a><a class="code" href="tfcms_8class_8php.html#a2b9b8783a30fb4f6a5f3d70dfeb6a3c5">00035</a> define(<span class="stringliteral">&quot;__root&quot;</span>, preg_replace(<span class="stringliteral">&quot;~/$~&quot;</span>, <span class="stringliteral">&quot;&quot;</span>, <a class="code" href="tfcms_8class_8php.html#a2e2d0cfd252afeac4d33f3f77b90226c">$_SERVER</a>[<span class="stringliteral">&quot;DOCUMENT_ROOT&quot;</span>]));
<a name="l00036"></a>00036 
<a name="l00037"></a>00037 require_once <span class="stringliteral">&quot;model_tfcms.class.php&quot;</span>;
<a name="l00038"></a>00038 require_once <span class="stringliteral">&quot;view_tfcms.class.php&quot;</span>;
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 chdir(<a class="code" href="tfcms_8class_8php.html#a2b9b8783a30fb4f6a5f3d70dfeb6a3c5">__root</a>);
<a name="l00041"></a>00041 
<a name="l00047"></a><a class="code" href="class_t_f_c_m_s.html">00047</a> <span class="keyword">class </span><a class="code" href="class_t_f_c_m_s.html" title="The TrueFusion CMS core class.">TFCMS</a>
<a name="l00048"></a>00048         {
<a name="l00049"></a><a class="code" href="class_t_f_c_m_s.html#a0fcc86a61e73ca8c55e71c57365c2572">00049</a>                 <span class="keyword">static</span> <span class="keyword">protected</span> <a class="code" href="class_t_f_c_m_s.html#a0fcc86a61e73ca8c55e71c57365c2572">$check_version</a> = <span class="keyword">true</span>;
<a name="l00050"></a><a class="code" href="class_t_f_c_m_s.html#a4d78d22732a2db7f27b3c39ab3a0f679">00050</a>                 <span class="keyword">static</span> <span class="keyword">protected</span> <a class="code" href="class_t_f_c_m_s.html#a4d78d22732a2db7f27b3c39ab3a0f679">$Model</a> = NULL;
<a name="l00051"></a><a class="code" href="class_t_f_c_m_s.html#adfe49c647d27eb2b424c3ea73082382f">00051</a>                 <span class="keyword">static</span> <span class="keyword">protected</span> <a class="code" href="class_t_f_c_m_s.html#adfe49c647d27eb2b424c3ea73082382f">$View</a> = NULL;
<a name="l00052"></a>00052 
<a name="l00060"></a><a class="code" href="class_t_f_c_m_s.html#a095c5d389db211932136b53f25f39685">00060</a>                 <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#a095c5d389db211932136b53f25f39685" title="TFCMS constructor.">__construct</a>(<span class="comment">/* $template = &quot;Default&quot;, $default = &quot;Default&quot;, $doctype = &quot;XHTML 1.1&quot;, $tpl_file = &quot;index.tpl.php&quot; */</span>)
<a name="l00061"></a>00061                         {
<a name="l00062"></a>00062                                 <span class="keywordflow">if</span> (self::$check_version)
<a name="l00063"></a>00063                                         <a class="code" href="class_t_f_c_m_s.html#abef08691f98cd68b7b70cb99094600ab" title="Version checking.">TFCMS::version_check</a>();
<a name="l00064"></a>00064 
<a name="l00065"></a>00065                                 self::$Model = <span class="keyword">new</span> <a class="code" href="class_t_f_c_m_s_model.html">TFCMSModel</a>();
<a name="l00066"></a>00066                                 <span class="keywordflow">if</span> (func_num_args() &gt; 0)
<a name="l00067"></a>00067                                 {
<a name="l00068"></a>00068                                         $args = func_get_args();
<a name="l00069"></a>00069                                         self::$View = <span class="keyword">new</span> <a class="code" href="class_t_f_c_m_s_view.html">TFCMSView</a>($args[0], $args[1], $args[2], $args[3]);
<a name="l00070"></a>00070                                 }
<a name="l00071"></a>00071 
<a name="l00072"></a>00072                                 <span class="keywordflow">else</span>
<a name="l00073"></a>00073                                         self::$View = <span class="keyword">new</span> <a class="code" href="class_t_f_c_m_s_view.html">TFCMSView</a>;
<a name="l00074"></a>00074 
<a name="l00075"></a>00075                                 self::$View-&gt;<a class="code" href="class_t_f_c_m_s_view.html#a58d17b03cf2242ecaf8c9227dfdc4809" title="Set the view&#39;s model.">setModel</a>(self::$Model);
<a name="l00076"></a>00076                         }
<a name="l00077"></a>00077 
<a name="l00082"></a><a class="code" href="class_t_f_c_m_s.html#a9ed0781fa1256597735da1079445855a">00082</a>                 <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#a9ed0781fa1256597735da1079445855a" title="Add JavaScript scripts for every page.">addGlobalJavaScripts</a>($script_paths)
<a name="l00083"></a>00083                         {
<a name="l00084"></a>00084                                 <span class="keywordflow">foreach</span> (explode(<span class="stringliteral">&quot;;&quot;</span>, $script_paths) as $path)
<a name="l00085"></a>00085                                         self::$View-&gt;addJavaScript($path);
<a name="l00086"></a>00086                         }
<a name="l00087"></a>00087 
<a name="l00098"></a><a class="code" href="class_t_f_c_m_s.html#a616df1501516754c285ff544f4d18cbb">00098</a>                 <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#a616df1501516754c285ff544f4d18cbb" title="Add meta data.">addMetaData</a>($name, $content)
<a name="l00099"></a>00099                         {
<a name="l00100"></a>00100                                 self::$View-&gt;addMetaData($name, $cotent);
<a name="l00101"></a>00101                         }
<a name="l00102"></a>00102 
<a name="l00107"></a><a class="code" href="class_t_f_c_m_s.html#ab842605b2f76a5c199da082f8931b3f5">00107</a>                 <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#ab842605b2f76a5c199da082f8931b3f5" title="Add stylesheets for every page.">addGlobalStyleSheets</a>($stylesheet_paths)
<a name="l00108"></a>00108                         {
<a name="l00109"></a>00109                                 <span class="keywordflow">foreach</span> (explode(<span class="stringliteral">&quot;;&quot;</span>, $stylesheet_paths) as $path)
<a name="l00110"></a>00110                                         self::$View-&gt;addStyleSheet($path);
<a name="l00111"></a>00111                         }
<a name="l00112"></a>00112 
<a name="l00117"></a><a class="code" href="class_t_f_c_m_s.html#a79b9980affb1bf91251f9b364585142f">00117</a>                 <span class="keyword">static</span> <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#a79b9980affb1bf91251f9b364585142f" title="Disables version checking.">disableVersionCheck</a>()
<a name="l00118"></a>00118                         {
<a name="l00119"></a>00119                                 self::$check_version = <span class="keyword">false</span>;
<a name="l00120"></a>00120                         }
<a name="l00121"></a>00121 
<a name="l00124"></a><a class="code" href="class_t_f_c_m_s.html#a442d47301c59f77e2b63c79dc6b46a76">00124</a>                 <span class="keyword">static</span> <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#a442d47301c59f77e2b63c79dc6b46a76" title="Enable debugging messages.">enableDebugging</a>()
<a name="l00125"></a>00125                         {
<a name="l00126"></a>00126                                 ini_set(<span class="stringliteral">&#39;display_errors&#39;</span>, <span class="charliteral">&#39;1&#39;</span>);
<a name="l00127"></a>00127                                 error_reporting(E_ALL);
<a name="l00128"></a>00128                                 define(<span class="stringliteral">&quot;TFCMS_DEBUG&quot;</span>, <span class="keyword">true</span>);
<a name="l00129"></a>00129                         }
<a name="l00130"></a>00130 
<a name="l00133"></a><a class="code" href="class_t_f_c_m_s.html#aabe69344490065ea05784e9f71512bc1">00133</a>                 <span class="keyword">static</span> <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#aabe69344490065ea05784e9f71512bc1" title="Get the current model.">getModel</a>()
<a name="l00134"></a>00134                         {
<a name="l00135"></a>00135                                 <span class="keywordflow">return</span> <a class="code" href="class_t_f_c_m_s.html#a4d78d22732a2db7f27b3c39ab3a0f679">self::$Model</a>;
<a name="l00136"></a>00136                         }
<a name="l00137"></a>00137 
<a name="l00140"></a><a class="code" href="class_t_f_c_m_s.html#a71862e4fc72a711783ca3f090b357d71">00140</a>                 <span class="keyword">static</span> <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#a71862e4fc72a711783ca3f090b357d71" title="Get the current view.">getView</a>()
<a name="l00141"></a>00141                         {
<a name="l00142"></a>00142                                 <span class="keywordflow">return</span> <a class="code" href="class_t_f_c_m_s.html#adfe49c647d27eb2b424c3ea73082382f">self::$View</a>;
<a name="l00143"></a>00143                         }
<a name="l00144"></a>00144 
<a name="l00147"></a><a class="code" href="class_t_f_c_m_s.html#a9e61cff921cf73f4ba488dacb09148cf">00147</a>                 <span class="keyword">static</span> <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#a9e61cff921cf73f4ba488dacb09148cf" title="Convenience function.">pathInfo</a>()
<a name="l00148"></a>00148                         {
<a name="l00149"></a>00149                                 <span class="keyword">static</span> $path_info = NULL;
<a name="l00150"></a>00150                                 <span class="keywordflow">if</span> ($path_info === NULL)
<a name="l00151"></a>00151                                         $path_info = str_replace(<a class="code" href="tfcms_8class_8php.html#a2e2d0cfd252afeac4d33f3f77b90226c">$_SERVER</a>[<span class="stringliteral">&#39;SCRIPT_NAME&#39;</span>], <span class="stringliteral">&#39;&#39;</span>, @<a class="code" href="tfcms_8class_8php.html#a2e2d0cfd252afeac4d33f3f77b90226c">$_SERVER</a>[<span class="stringliteral">&#39;PATH_INFO&#39;</span>]);
<a name="l00152"></a>00152 
<a name="l00153"></a>00153                                 <span class="keywordflow">return</span> $path_info;
<a name="l00154"></a>00154                         }
<a name="l00155"></a>00155 
<a name="l00163"></a><a class="code" href="class_t_f_c_m_s.html#ad49c02c820c17af492b6678a06a5387c">00163</a>                 <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#ad49c02c820c17af492b6678a06a5387c" title="Finishing piece to the puzzle.">renderHtml</a>()
<a name="l00164"></a>00164                         {
<a name="l00165"></a>00165                                 self::$View-&gt;renderDocType();
<a name="l00166"></a>00166                                 echo <span class="stringliteral">&quot;&lt;head&gt;\n&quot;</span>;
<a name="l00167"></a>00167                                 $separator = (defined(<span class="stringliteral">&quot;TFCMS_SUB_TITLE&quot;</span>)) ? <span class="stringliteral">&quot; -- &quot;</span> : <span class="stringliteral">&quot;&quot;</span>;
<a name="l00168"></a>00168                                 echo <span class="stringliteral">&quot;&lt;title&gt;&quot;</span> . TFCMS_TITLE . $separator . TFCMS_SUB_TITLE . <span class="stringliteral">&quot; - &quot;</span> . self::$View-&gt;currentPageTitle() . <span class="stringliteral">&quot;&lt;/title&gt;\n&quot;</span>;
<a name="l00169"></a>00169                                 self::$View-&gt;renderMetaData();
<a name="l00170"></a>00170                                 self::$View-&gt;renderFavicon();
<a name="l00171"></a>00171                                 self::$View-&gt;renderStyleSheet();
<a name="l00172"></a>00172                                 self::$View-&gt;renderJavaScript();
<a name="l00173"></a>00173                                 echo <span class="stringliteral">&quot;&lt;/head&gt;\n&quot;</span>;
<a name="l00174"></a>00174                                 echo <span class="stringliteral">&quot;&lt;body&gt;\n&quot;</span>;
<a name="l00175"></a>00175                                 self::$View-&gt;parseTemplate();
<a name="l00176"></a>00176                                 $curr = self::$Model-&gt;currentCategory();
<a name="l00177"></a>00177                                 <span class="keywordflow">if</span> ($curr != null)
<a name="l00178"></a>00178                                         self::$View-&gt;renderClosingJavaScript($curr);
<a name="l00179"></a>00179                                 echo <span class="stringliteral">&quot;&lt;/body&gt;\n&quot;</span>;
<a name="l00180"></a>00180                                 echo <span class="stringliteral">&quot;&lt;/html&gt;&quot;</span>;
<a name="l00181"></a>00181                         }
<a name="l00182"></a>00182 
<a name="l00187"></a><a class="code" href="class_t_f_c_m_s.html#a6c4676bc0ec1136eb324a26f0ac6252b">00187</a>                 <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#a6c4676bc0ec1136eb324a26f0ac6252b" title="Set the global favicon.">setFavicon</a>($favicon)
<a name="l00188"></a>00188                         {
<a name="l00189"></a>00189                                 self::$View-&gt;setFavicon($favicon);
<a name="l00190"></a>00190                         }
<a name="l00191"></a>00191 
<a name="l00196"></a><a class="code" href="class_t_f_c_m_s.html#ae87488f29297453f492257d6b67c6b4a">00196</a>                 <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#ae87488f29297453f492257d6b67c6b4a">setGlobalFileTypes</a>($file_types)
<a name="l00197"></a>00197                         {
<a name="l00198"></a>00198                                 <span class="keywordflow">foreach</span> (explode(<span class="stringliteral">&quot;;&quot;</span>, $file_types) as $file_type)
<a name="l00199"></a>00199                                         self::$Model-&gt;addFileType($file_type);
<a name="l00200"></a>00200                         }
<a name="l00201"></a>00201 
<a name="l00206"></a><a class="code" href="class_t_f_c_m_s.html#ac768f7d881f8f0b2520bb62f5399e013">00206</a>                 <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#ac768f7d881f8f0b2520bb62f5399e013">setHomePage</a>($home_page)
<a name="l00207"></a>00207                         {
<a name="l00208"></a>00208                                 self::$Model-&gt;setHomePage($home_page);
<a name="l00209"></a>00209                         }
<a name="l00210"></a>00210 
<a name="l00219"></a><a class="code" href="class_t_f_c_m_s.html#a58d17b03cf2242ecaf8c9227dfdc4809">00219</a>                 <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#a58d17b03cf2242ecaf8c9227dfdc4809" title="Set the current model to $model.">setModel</a>(<a class="code" href="class_t_f_c_m_s_abstract_model.html">TFCMSAbstractModel</a> &amp;$model)
<a name="l00220"></a>00220                         {
<a name="l00221"></a>00221                                 <span class="keywordflow">if</span> (count(self::$Model-&gt;getCategories()))
<a name="l00222"></a>00222                                         <span class="keywordflow">throw</span> <span class="keyword">new</span> LogicException(<span class="stringliteral">&quot;Attempting to replace a model containing categories.&quot;</span>);
<a name="l00223"></a>00223 
<a name="l00224"></a>00224                                 self::$Model = $model;
<a name="l00225"></a>00225                                 self::$View-&gt;setModel($model);
<a name="l00226"></a>00226                         }
<a name="l00227"></a>00227 
<a name="l00232"></a><a class="code" href="class_t_f_c_m_s.html#a4dc09c9c30240d9f541aee1b9f162acb">00232</a>                 <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#a4dc09c9c30240d9f541aee1b9f162acb" title="Set global site sub-title.">setSiteSubTitle</a>($subtitle)
<a name="l00233"></a>00233                         {
<a name="l00234"></a>00234                                 define(<span class="stringliteral">&quot;TFCMS_SUB_TITLE&quot;</span>, $subtitle);
<a name="l00235"></a>00235                         }
<a name="l00236"></a>00236 
<a name="l00241"></a><a class="code" href="class_t_f_c_m_s.html#a9685cc9f8c82d140ef0adec037ac8bd0">00241</a>                 <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#a9685cc9f8c82d140ef0adec037ac8bd0" title="Set global site title.">setSiteTitle</a>($title)
<a name="l00242"></a>00242                         {
<a name="l00243"></a>00243                                 define(<span class="stringliteral">&quot;TFCMS_TITLE&quot;</span>, $title);
<a name="l00244"></a>00244                         }
<a name="l00245"></a>00245 
<a name="l00250"></a><a class="code" href="class_t_f_c_m_s.html#a91205755a57eef57abf03cf90eca2d5b">00250</a>                 <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#a91205755a57eef57abf03cf90eca2d5b" title="Set the current view to $view.">setView</a>(<a class="code" href="class_t_f_c_m_s_abstract_view.html">TFCMSAbstractView</a> &amp;$view)
<a name="l00251"></a>00251                         {
<a name="l00252"></a>00252                                 self::$View = $view;
<a name="l00253"></a>00253                                 self::$View-&gt;<a class="code" href="class_t_f_c_m_s_abstract_view.html#a58d17b03cf2242ecaf8c9227dfdc4809">setModel</a>(self::$Model);
<a name="l00254"></a>00254                         }
<a name="l00255"></a>00255 
<a name="l00263"></a><a class="code" href="class_t_f_c_m_s.html#a458266d3bef0f2b396a0a17da3081431">00263</a>                 <span class="keyword">static</span> <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#a458266d3bef0f2b396a0a17da3081431" title="Convenience function.">trigger_error</a>($message, $error_type)
<a name="l00264"></a>00264                         {
<a name="l00265"></a>00265                                 $debug = debug_backtrace();
<a name="l00266"></a>00266 
<a name="l00267"></a>00267                                 <span class="keywordflow">if</span> ($error_type == E_USER_WARNING)
<a name="l00268"></a>00268                                         $error_type = <span class="stringliteral">&quot;Warning&quot;</span>;
<a name="l00269"></a>00269                                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> ($error_type == E_USER_ERROR)
<a name="l00270"></a>00270                                         $error_type = <span class="stringliteral">&quot;Error&quot;</span>;
<a name="l00271"></a>00271 
<a name="l00272"></a>00272                                 echo <span class="stringliteral">&quot;&lt;p class=\&quot;backtrace\&quot;&gt;\n&lt;b&gt;$error_type:&lt;/b&gt; $message: &lt;/p&gt;\n&quot;</span>;
<a name="l00273"></a>00273                                 echo <span class="stringliteral">&quot;&lt;ul class=\&quot;backtrace\&quot;&gt;\n&quot;</span>;
<a name="l00274"></a>00274                                 <span class="keywordflow">foreach</span> ($debug as $key =&gt; $bt)
<a name="l00275"></a>00275                                 {
<a name="l00276"></a>00276                                         <span class="keywordflow">if</span> (!$key)
<a name="l00277"></a>00277                                                 <span class="keywordflow">continue</span>;
<a name="l00278"></a>00278 
<a name="l00279"></a>00279                                         $separator = (@$bt[<span class="stringliteral">&#39;type&#39;</span>]) ? <span class="stringliteral">&quot;::&quot;</span> : <span class="stringliteral">&quot;&quot;</span>;
<a name="l00280"></a>00280                                         echo <span class="stringliteral">&quot;\t&lt;li&gt;\n&quot;</span>;
<a name="l00281"></a>00281                                         echo <span class="stringliteral">&quot;\t\tfrom &lt;i&gt;&lt;u&gt;&quot;</span>.@$bt[<span class="stringliteral">&#39;class&#39;</span>].$separator.$bt[<span class="stringliteral">&#39;function&#39;</span>].<span class="stringliteral">&quot;()&lt;/u&gt;&lt;/i&gt; on line &lt;b&gt;&quot;</span>.$bt[<span class="stringliteral">&#39;line&#39;</span>].<span class="stringliteral">&quot;&lt;/b&gt; of file &lt;b&gt;&quot;</span>.$bt[<span class="stringliteral">&#39;file&#39;</span>].<span class="stringliteral">&quot;&lt;/b&gt;;\n&quot;</span>;
<a name="l00282"></a>00282                                         echo <span class="stringliteral">&quot;\t&lt;/li&gt;\n&quot;</span>;
<a name="l00283"></a>00283                                 }
<a name="l00284"></a>00284                                 echo <span class="stringliteral">&quot;&lt;/ul&gt;\n\n&quot;</span>;
<a name="l00285"></a>00285 
<a name="l00286"></a>00286                                 <span class="keywordflow">if</span> ($error_type == <span class="stringliteral">&quot;Error&quot;</span>)
<a name="l00287"></a>00287                                         exit();
<a name="l00288"></a>00288                         }
<a name="l00289"></a>00289 
<a name="l00295"></a><a class="code" href="class_t_f_c_m_s.html#abef08691f98cd68b7b70cb99094600ab">00295</a>                 <span class="keyword">static</span> <span class="keyword">function</span> <a class="code" href="class_t_f_c_m_s.html#abef08691f98cd68b7b70cb99094600ab" title="Version checking.">version_check</a>()
<a name="l00296"></a>00296                         {
<a name="l00297"></a>00297                                 <span class="keywordflow">if</span> (!defined(<span class="stringliteral">&#39;PHP_VERSION_ID&#39;</span>))
<a name="l00298"></a>00298                                 {
<a name="l00299"></a>00299                                         $version = explode(<span class="charliteral">&#39;.&#39;</span>, PHP_VERSION);
<a name="l00300"></a>00300                                         define(<span class="stringliteral">&#39;PHP_VERSION_ID&#39;</span>, ($version[0] * 10000 + $version[1] * 100 + $version[2]));
<a name="l00301"></a>00301                                 }
<a name="l00302"></a>00302 
<a name="l00303"></a>00303                                 <span class="keywordflow">if</span> (PHP_VERSION_ID &lt; 50304)
<a name="l00304"></a>00304                                         <span class="keywordflow">throw</span> <span class="keyword">new</span> RuntimeException(<span class="stringliteral">&quot;PHP version 5.3.4 or higher is recommended for TFCMS.&quot;</span>);
<a name="l00305"></a>00305                         }
<a name="l00306"></a>00306         }
<a name="l00307"></a>00307 
<a name="l00308"></a>00308 ?&gt;
</pre></div></div><!-- contents -->
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="tfcms_8class_8php.html">tfcms.class.php</a>      </li>

    <li class="footer">Generated on Mon Aug 6 2012 13:10:01 for TFCMS by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
